<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改布控信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-control-edit" th:object="${control}">
            <input name="controlId" th:field="*{controlId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车牌号码：</label>
                <div class="col-sm-8">
                    <input name="carNum" th:field="*{carNum}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">号牌种类：</label>
                <div class="col-sm-8">
                    <select name="carNumType" class="form-control m-b" th:with="type=${@dict.getType('car_num_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{carNumType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">布控单号：</label>
                <div class="col-sm-8">
                    <input name="controlNum" th:field="*{controlNum}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">布控类型：</label>
                <div class="col-sm-8">
                    <select name="controlType" class="form-control m-b" th:with="type=${@dict.getType('control_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{controlType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效期止：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="validUntil" th:value="${#dates.format(control.validUntil, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效期开始：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="validStart" th:value="${#dates.format(control.validStart, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">布控人：</label>
                <div class="col-sm-8">
                    <input name="controlOwner" th:field="*{controlOwner}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">布控单位：</label>
                <div class="col-sm-8">
                    <input name="controlOrg" th:field="*{controlOrg}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">移动电话：</label>
                <div class="col-sm-8">
                    <textarea name="tels" class="form-control">[[*{tels}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">案情简介：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效状态：</label>
                <div class="col-sm-8">
                    <select name="isState" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isState}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否跨市布控：</label>
                <div class="col-sm-8">
                    <input name="isShi" th:field="*{isShi}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">审核状态：</label>
                <div class="col-sm-8">
                    <select name="shenState" class="form-control m-b" th:with="type=${@dict.getType('shen_state')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shenState}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发布时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="controlDate" th:value="${#dates.format(control.controlDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">布控区域：</label>
                <div class="col-sm-8">
                    <input name="controlRegion" th:field="*{controlRegion}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "control/control";
        $("#form-control-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-control-edit').serialize());
            }
        }

        $("input[name='validUntil']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='validStart']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='controlDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>